<div class="kx_search_result kx_display">
	<div class="kx_head">
		<h1 class="kx_title">Wyniki wyszukiwania</h1>
		<form action="" method="get">
			<?php print $this->formText('find', $this->find, array('class' => 'kx_search_input'))?>
			<input type="submit" value="Szukaj" />
		</form>
	</div>
	<div class="kx_content">
		<?php if(null === $this->rowset):?>
		<div class="kx_block kx_search_result_empty">
			<?php print $this->getHelper('site')->get('static')->setAlias('kx_search_result_empty')->render(null,'Nie znaleziono szukajen frazy')?>
		</div>
		<?php else:?>
		<ul class="ks_list">
			<?php
				/* @var $url Zend_View_Helper_Url */
				$urlHelper = $this->getHelper('Url');

				/* @var $colorFind Search_View_Helper_ColorFind */
				$colorFind = $this->getHelper('ColorFind');
				$colorFind->setFindText($this->find);
			?>
			<?php
				foreach ($this->rowset as $row):
					$time_create = strtotime($row['time_create']);
			?>
			<li class="kx_item kx_type_<?php print $row['type'] ?>">
				<div class="kx_time">
					<em class="kx_day"><?php print date('d', $time_create)?></em>
					<em class="kx_month"><?php print $this->translate(strtolower(date('F', $time_create)))?></em>
					<em class="kx_year"><?php print date('Y', $time_create)?></em>
				</div>
				<div class="kx_content">
					<div class="kx_head">
						<?php
							switch ($row['type']) {
								case 'site': $url = $urlHelper->url(array('module' => 'site', 
																		  'controller' => 'site', 
																		  'action' => 'display',
																		  'id' => $row['id']), 'default', true); break;
		
								case 'news': $url = $urlHelper->url(array('module' => 'news', 
																		  'controller' => 'news', 
																		  'action' => 'display',
																		  'id' => $row['id']), 'default', true); break;
							}
						?>
						<h6 class="kx_title"><a href="<?php print $url?>"><?php print $colorFind->colorFind($this->escape($row['name']))?></a></h6>
					</div>
					<div class="kx_description"><?php print $colorFind->colorFind(strip_tags($row['content']))?></div>
				</div>
			</li>
			<?php endforeach;?>
		</ul>
		<?php endif;?>
	</div>
</div>